﻿/*****************************************************************//**
 * @file    FITKAcousticsVTKGraphObjectSEASelectMergedData.h
 * @brief   Graph object for highlighting part of the merged data.
 *  
 * @author  ChengHaotian (yeguangbaozi@foxmail.com)
 * @date    2024-11-18
 *********************************************************************/

#ifndef __FITKACOUSTICSVTKGRAPHOBJECTSEASELECTMERGEDDATA_H__
#define __FITKACOUSTICSVTKGRAPHOBJECTSEASELECTMERGEDDATA_H__

#include "FITKAcousticsVTKGraphObject3D.h"

#include "FITKAcousticsVTKGraphAdaptorAPI.h"

#include <QVector>

// Forward declaration
class vtkMultiBlockDataSet;
class vtkCompositeDataGeometryFilter;

class FITKAcousticsVTKGraphActor;

namespace Exchange
{
    /**
     * @brief   Graph object for highlighting part of the merged data.
     * @author  ChengHaotian (yeguangbaozi@foxmail.com)
     * @date    2024-11-18
     */
    class FITKACOUSTICSGRAPHADAPTORAPI FITKAcousticsVTKGraphObjectSEASelectMergedData : public FITKAcousticsVTKGraphObject3D
    {
        // Regist
        FITKGraphObjectRegist(FITKAcousticsVTKGraphObjectSEASelectMergedData, FITKAcousticsVTKGraphObject3D);
        FITKCLASS(Exchange, FITKAcousticsVTKGraphObjectSEASelectMergedData);

    public:
        /**
         * @brief   Constructor.
         * @author  ChengHaotian (yeguangbaozi@foxmail.com)
         * @date    2024-11-18
         */
        FITKAcousticsVTKGraphObjectSEASelectMergedData();

        /**
         * @brief   Destructor.[virtual]
         * @author  ChengHaotian (yeguangbaozi@foxmail.com)
         * @date    2024-11-18
         */
        ~FITKAcousticsVTKGraphObjectSEASelectMergedData();

        /**
         * @brief   Set the data id list visualization.
         * @param   ids: The id list of the data[quote]
         * @author  ChengHaotian (yeguangbaozi@foxmail.com)
         * @date    2024-11-18
         */
        void setSelectData(QVector<int> & ids);

        /**
         * @brief   Add the data id for visualization.
         * @param   id: The id of the data
         * @author  ChengHaotian (yeguangbaozi@foxmail.com)
         * @date    2024-11-18
         */
        void addSelectData(int id);

        /**
        * @brief   Set the color.[override]
        * @param   color: The color
        * @author  ChengHaotian (yeguangbaozi@foxmail.com)
        * @date    2024-11-18
        */
        void setColor(QColor color) override;

        /**
         * @brief   Clear the select data indice.
         * @author  ChengHaotian (yeguangbaozi@foxmail.com)
         * @date    2024-11-18
         */
        void clearData();

    private:
        /**
         * @brief   Intialize.
         * @author  ChengHaotian (yeguangbaozi@foxmail.com)
         * @date    2024-11-18
         */
        void init();

    private:
        /**
         * @brief   The multi block dataset for highlighting.
         * @author  ChengHaotian (yeguangbaozi@foxmail.com)
         * @date    2024-11-18
         */
        vtkMultiBlockDataSet* m_mDataSet{ nullptr };

        /**
         * @brief   The filter for merging multi block dataset.
         * @author  ChengHaotian (yeguangbaozi@foxmail.com)
         * @date    2024-11-18
         */
        vtkCompositeDataGeometryFilter* m_comp2Poly{ nullptr };

        /**
         * @brief   The actor for the sub-system grid.
         * @author  ChengHaotian (yeguangbaozi@foxmail.com)
         * @date    2024-11-18
         */
        FITKAcousticsVTKGraphActor* m_fActor{ nullptr };

        /**
         * @brief   The data ids of the selected objects.
         * @author  ChengHaotian (yeguangbaozi@foxmail.com)
         * @date    2024-11-18
         */
        QVector<int> m_selectedDataIds;

    };
}   // namespace Exchange

#endif // __FITKACOUSTICSVTKGRAPHOBJECTSEASELECTMERGEDDATA_H__
